package com.example.app.data.enum

import com.example.app.R

enum class DividerState(
    var label: String,
    var value: Any,
    var key: String
) {

    //垂直
    VER(
        "垂直",
        false,
        "VER"
    ),
    //水平
    HOR(
        "水平",
        true,
        "HOR"
    )
    ;

    companion object {
        fun getVarByLabel(label: String): DividerState? {
            values().forEach {
                if (label == it.label) return it
            }
            return null
        }

        fun getVarByValue(value: Any): DividerState? {
            values().forEach {
                if (value == it.value) return it
            }
            return null
        }

        fun getVarByKey(key: String): DividerState? {
            values().forEach {
                if (it.key == key) return it
            }
            return null
        }
    }
}